package com.ljb.android.component.home.adapter

import com.ljb.android.comm.img.ImageLoader
import com.ljb.android.comm.utils.DefResUtils
import com.ljb.android.component.home.bean.BannerBean
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder

/**
 * Author:Ljb
 * Time:2021/1/28
 * There is a lot of misery in life
 **/
class HomeBannerAdapter(data: List<BannerBean.DataBean>) :
    BannerImageAdapter<BannerBean.DataBean>(data) {
    override fun onBindView(
        holder: BannerImageHolder,
        data: BannerBean.DataBean,
        position: Int,
        size: Int
    ) {
        ImageLoader.Builder(data.imagePath, holder.imageView)
            .preDrawable(DefResUtils.getDefImg(holder.imageView.context))
            .errorDrawable(DefResUtils.getDefImg(holder.imageView.context))
            .build(holder.imageView.context)
            .load()
    }


}